<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/order/totalData/saasTotalData.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <style>
        .bootstrap-table .fixed-table-container .table thead th .th-inner {
            text-align: center !important;
        }
        .fixed-table-toolbar{
            display: block;
            top: -2px;
            right: 150px;
            position: absolute;
            z-index: 100000;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>财务管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>Saas第三方财务统计</strong>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <input id="tenantCode" name="tenantCode" value="${tenant.tenantCode}" type="hidden">
                    <input id="stationName" name="stationName" type="text" class="form-control shortInput"
                           placeholder="站点名称">
                    <select class="form-control shortInput input-distance" name="hlhtOperator" id="hlhtOperatorId">
                        <option value="" selected>互联运营商</option>
                        <c:forEach items="${hlhtOperators}" var="hlhtOperator">
                            <option value="${hlhtOperator.hlhtOperatorId}">${hlhtOperator.hlhtOperatorName}</option>
                        </c:forEach>
                    </select>
                    <select class="form-control shortInput input-distance" name="equipmentHlhtOperatorId"
                            id="equipmentHlhtOperatorId">
                        <option value="" selected>设备运营商</option>
                        <c:forEach items="${tenantList}" var="tenant">
                            <option value="${tenant.tenantCode}">${tenant.tenantName}</option>
                        </c:forEach>
                    </select>
                    <input id="startTime" name="startTime" type="text" class="form-control shortInput input-distance"
                           placeholder="开始时间">
                    <input id="endTime" name="endTime" type="text" class="form-control shortInput input-distance"
                           placeholder="结束时间">

                    <button class="btn btn-success input-distance" onclick="saasTotalData.reLoad()">查询</button>

                    <div class="pull-left search fr exportNumInput">
                        <input id="count" name="count" type="text" class="form-control"
                               placeholder="导出条数">
                    </div>
                    <div class="pull-left search fr">
                        <button class="btn btn-success exportBtn" onclick="saasTotalData.printTotalData()">导出</button>
                    </div>
                </div>
                <table id="exampleTable" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $('#equipmentHlhtOperatorId').searchableSelect();
    })

    $(function () {
        $('#hlhtOperatorId').searchableSelect();
    })

    var thisDate = new Date();
    var year = thisDate.getFullYear();
    var month = thisDate.getMonth() + 1;
    var date = thisDate.getDate();
    if (month < 10) {
        month = '0' + month
    }
    if (date < 10) {
        date = '0' + date
    }

    $('#startTime').val(year + '-' + month + '-' + date + ' ' + '00:00:00');

    $('#endTime').val(year + '-' + month + '-' + date + ' ' + '23:59:59');


    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤

    saasTotalData.init();
</script>
</body>
</html>
